<%@page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title>首页-Baiding管理系统</title>
	<jsp:include page="/common/layout_head.jsp"></jsp:include>
</head>
<body>
<section class="main-content">
	<div class="content-wrap">
		<h1>Baiding管理系统</h1>
		<div class="row">
	
			<div class="col-md-3 col-sm-4 col-xs-6">
				<section class="panel panel-default">
					<div class="panel-body">
						<div class="circle-icon bg-success">
							<i class="fa fa-microphone"></i>
						</div>
						<div>
							<h3 class="no-margin">${userCount}</h3> 用户数
						</div>
					</div>
				</section>
			</div>
			<div class="col-md-3 col-sm-4 col-xs-6">
				<section class="panel panel-default">
					<div class="panel-body">
						<div class="circle-icon bg-default">
							<i class="fa fa-magnet"></i>
						</div>
						<div>
							<h3 class="no-margin">${groupCount}</h3> 角色数
						</div>
					</div>
				</section>
			</div>
			<div class="col-md-3 col-sm-4 col-xs-6">
				<section class="panel panel-default">
					<div class="panel-body">
						<div class="circle-icon bg-danger">
							<i class="fa fa-anchor"></i>
						</div>
						<div>
							<h3 class="no-margin">${modelCount}</h3> 业务数
						</div>
					</div>
				</section>
			</div>
			<div class="col-md-3 col-sm-4 col-xs-6">
				<section class="panel panel-default">
					<div class="panel-body">
						<div class="circle-icon bg-info">
							<i class="fa fa-anchor"></i>
						</div>
						<div>
							<h3 class="no-margin">${taskCount}</h3> 任务数
						</div>
					</div>
				</section>
			</div>
			
		</div>
		
		<div id="ajax-content" class="clear" >
			<div class="preloader">
				<img src="images/img/devoops_getdata.gif" class="devoops-getdata" alt="preloader"/>
			</div>			
		</div>	
	</div>
</section>

<script type="text/javascript">
    
    $(document).ready(function(){
    	var url = "${ctx}/dashboard"
    	$.ajax({
    		mimeType: 'text/html; charset=utf-8', // ! Need set mimeType only when run from local file
    		url: url,
    		type: 'GET',
    		success: function(data) {
    			$('#ajax-content').html(data);
    			$('.preloader').hide();
    		},
    		error: function (jqXHR, textStatus, errorThrown) {
    			alert("ajax load "+textStatus+":"+errorThrown);
    		},
    		dataType: "html",
    		async: false
    	});
    });

</script>
</body>
</html>
